package com.movecar.utils;

import java.io.File;

import android.app.Activity;
import android.content.Intent;
import android.provider.MediaStore;

import com.droid4you.util.cropimage.CropImage;

public class BitmapCropper {

	public static void cropSquarePicture(final Activity activity, final File input, final File output, final int size,
			final int requestCode) {
		final Intent intent = new Intent(activity, CropImage.class);
		intent.putExtra(MediaStore.EXTRA_OUTPUT, output.getPath());
		intent.putExtra("image-path", input.getPath());
		intent.putExtra("aspectX", 1);//宽高比例
		intent.putExtra("aspectY", 1);
		intent.putExtra("outputX", size);//裁剪图片的宽高
		intent.putExtra("outputY", size);
		intent.putExtra("outputFormat", "PNG");
		activity.startActivityForResult(intent, requestCode);
	}
}
